package org.example.client.order.dto.cmd;

import com.alibaba.cola.dto.Command;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class OrderCreateCmd extends Command {

    /**
     * 实际支付金额(单位：分)
     */
    @NotNull(message = "实际支付金额不能为空")
    @PositiveOrZero(message = "实际支付金额必须大于等于0")
    private Long payAmount;

    /**
     * 订单商品列表
     */
    @Valid
    @NotEmpty(message = "订单商品列表不能为空")
    private List<OrderItemCreateCmd> orderItemList;
}
